Skip to content

Conversation

ViezeVingertjes
Copy link

@ViezeVingertjes ViezeVingertjes commented Sep 2, 2025

This update replaces the old dirty_contacts_expiry timer with a smarter, debounced system for saving contacts.

  • A new method, markContactsChanged(), keeps track of when contact data is modified.
  • Contacts are written to storage after one minute of no changes, or at least every five minutes.
  • The onContactDataChanged() hook is now called across update paths in BaseChatMesh and MyMesh to automatically flag changes when important fields are updated.
  • The shutdown and reboot logic in the UI now forces a final flush before powering off.

Overall, this makes contact persistence more reliable while keeping unnecessary writes to a minimum.

…a debounced save mechanism. Introduce methods to track contact changes and ensure contacts are saved if modified before shutdown. Update UI tasks to flush contacts if dirty during reboot and power off.
@ViezeVingertjes ViezeVingertjes marked this pull request as ready for review September 5, 2025 06:17
@ViezeVingertjes ViezeVingertjes marked this pull request as draft September 7, 2025 14:14
…ensure contacts are updated on path changes and received messages.
…as changed on relevant events in MyMesh. This includes updates on contact discovery, path changes, and message reception.
@ViezeVingertjes ViezeVingertjes marked this pull request as ready for review September 8, 2025 08:30
@ViezeVingertjes ViezeVingertjes changed the title Reduce flash writes Improve contact persistence with debounced saving Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant